/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.swirrel.example;

import java.awt.Button;
import java.awt.FlowLayout;
import org.swirrel.annotation.ActionPerformed;
import org.swirrel.annotation.WindowClosing;
import org.swirrel.component.SwAwtFrame;

/**
 *
 * @author Gronau
 */
public class AwtExampleSwAwtFrame extends SwAwtFrame {

    @ActionPerformed("react")
    private Button button = new Button("Test - 0");
    private int count = 0;
    @WindowClosing("exit")
    private AwtExampleSwAwtFrame self = this;

    private AwtExampleSwAwtFrame() {
        super("AWT Example");
        setLocation(100,100);
        setSize(250,100);
        setLayout(new FlowLayout(FlowLayout.CENTER));
        add(button);
        setVisible(true);
    }

    private void exit() {
        System.exit(0);
    }

    private void react() {
        button.setLabel("Test - " + (++count));
    }

    public static void main(String[] args) {
        new AwtExampleSwAwtFrame();
    }
}
